
//商品列表
//http://chst.vip:1234/api/getbrandproductlist

//获取数据传参
// brandtitleid
let name = getQueryString('tit')
// console.log(name);
let id = getQueryString('brandtitleid')
console.log(id);
let ww = 'pagesize=' + 4

let uu = document.querySelector('.cast')
console.log(uu);


fetch(`http://chst.vip:1234/api/getbrandproductlist?pagesize${ww}&brandtitleid=` + id)
    .then(body => body.json())
    .then(res => {
        console.log(res);
        let data = res.result
        console.log(data);
        let html = ''
        data.forEach(item => {
            html += `
            <li>
                    <a href="比价3详情.html?categoryid=${item.categoryId}&productid=${item.productId}">
                        <div class="Png">
                            ${item.productImg}
                        </div>
                        <div class="All">
                            <div class="allTop">
                                <h4>${item.productName}</h4>
                                <div>${item.productPrice}</div>
                            </div>
                            <div class="allbtm">
                                <span>${item.productQuote}</span>
                                <i>${item.productCom}</i>
                            </div>
                        </div>
                    </a>
                    </li>

                    `

        })


        uu.innerHTML = html

        let nav = document.querySelector('.nav')

        let html1 = `
        <a href="./../index.html"><span>首页></span></span></a>
        <a href="./品牌大全.html"><span class="yi">全部分页></span></span></a>
        <a href="brangDetail.html?brandtitleid=${id}"><span class="er">${name}></span> </span></a>
        `

        nav.innerHTML = html1

        // uu.appendChild(li)
    })  